<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">
      
	<ui:define name="body">

		<h:form id="komitentForm">


			<rich:panel>
				<f:facet name="header">Komitent</f:facet>

				<p>Unesite podatke o komitentu</p>


				<div class="dialog"><a4j:outputPanel id="panel">

					<h:panelGrid columns="3" rowClasses="prop"
						columnClasses="name,value,errormsg">

						<h:outputLabel for="naziv">Naziv</h:outputLabel>
						<h:inputText id="naziv" required="true"
							requiredMessage="Unesite naziv" value="#{komitent.naziv}" />
						 <rich:message for="naziv">
                        <f:facet name="passedMarker">
                            <img  src="#{request.contextPath}/img/passed.gif" /> 
                        </f:facet>
                        <f:facet name="errorMarker">
                            <img  src="#{request.contextPath}/img/errormsg.gif" />   
                        </f:facet>
                    </rich:message>

						<h:outputLabel for="mesto">Mesto</h:outputLabel>
						<h:inputText id="mesto" requiredMessage="Mesto"
							value="#{komitent.mesto}" required="true" />
						 <rich:message for="mesto">
                          <f:facet name="passedMarker">
                            <img  src="#{request.contextPath}/img/passed.gif" /> 
                        </f:facet>
                        <f:facet name="errorMarker">
                            <img  src="#{request.contextPath}/img/errormsg.gif" />   
                        </f:facet>
                    </rich:message>

						<h:outputLabel for="adresa">Adresa</h:outputLabel>
						<h:inputText id="adresa" requiredMessage="Unesite adresu"
							value="#{komitent.adresa}" required="true" />
						 <rich:message for="adresa">
                         <f:facet name="passedMarker">
                            <img  src="#{request.contextPath}/img/passed.gif" /> 
                        </f:facet>
                        <f:facet name="errorMarker">
                            <img  src="#{request.contextPath}/img/errormsg.gif" />   
                        </f:facet>
                    </rich:message>


						<h:outputLabel for="ziroracun">Ziro-Racun</h:outputLabel>
						<h:inputText id="ziroracun" requiredMessage="Unesite ziroRacun"
							value="#{komitent.ziroRacun}" required="true" />
						 <rich:message for="ziroracun">
                         <f:facet name="passedMarker">
                            <img  src="#{request.contextPath}/img/passed.gif" /> 
                        </f:facet>
                        <f:facet name="errorMarker">
                            <img  src="#{request.contextPath}/img/errormsg.gif" />   
                        </f:facet>
                    </rich:message>

						<h:outputLabel for="telefon">Telefon</h:outputLabel>
						<h:inputText id="telefon" requiredMessage="Unesite telefon"
							value="#{komitent.telefon}" required="true" />
						 <rich:message for="telefon">
                         <f:facet name="passedMarker">
                            <img  src="#{request.contextPath}/img/passed.gif" /> 
                        </f:facet>
                        <f:facet name="errorMarker">
                            <img  src="#{request.contextPath}/img/errormsg.gif" />   
                        </f:facet>
                    </rich:message>

						<h:outputLabel for="jib">JIB</h:outputLabel>
						<h:inputText id="jib" requiredMessage="Unesite JIB"
							value="#{komitent.JIB}" required="true" />
						 <rich:message for="jib">
                         <f:facet name="passedMarker">
                            <img  src="#{request.contextPath}/img/passed.gif" /> 
                        </f:facet>
                        <f:facet name="errorMarker">
                            <img  src="#{request.contextPath}/img/errormsg.gif" />   
                        </f:facet>
                    </rich:message>
						<h:outputLabel for="jmb">JMB</h:outputLabel>
						<h:inputText id="jmb" requiredMessage="Unesite JMB"
							value="#{komitent.JMB}" required="true" />
						 <rich:message for="jmb">
                         <f:facet name="passedMarker">
                            <img  src="#{request.contextPath}/img/passed.gif" /> 
                        </f:facet>
                        <f:facet name="errorMarker">
                            <img  src="#{request.contextPath}/img/errormsg.gif" />   
                        </f:facet>
                    </rich:message>
					</h:panelGrid>
				</a4j:outputPanel></div>
			</rich:panel>
			<s:div id="buttons" styleClass="actionButtons">
				<a4j:commandButton id="save" value="Save"
					rendered="#{komitent.id==null}"
					action="#{komitentPage.save}"
					reRender="table,buttons,panel" />

				<a4j:commandButton id="delete" value="Delete"
					rendered="#{komitent.id!=null}"
					action="#{komitentPage.delete}"
					reRender="table,buttons,panel" />

				<a4j:commandButton id="update" value="Update"
					rendered="#{komitent.id!=null}"
					action="#{komitentPage.update}"
					reRender="table,buttons,panel" />

				<s:button value="Cancel" id="cancel"
					action="#{komitentPage.cancel}" />

			</s:div>
		</h:form>
		<h:form>
			<rich:panel>
				<f:facet name="header">Lista komitenata</f:facet>

				<rich:dataTable id="table" value="#{listKomitent}" var="p">

					<rich:column>
						<f:facet name="header">Naziv</f:facet>
						<a4j:commandLink id="select" ajaxSingle="true" value="#{p.naziv}"
							action="#{komitentPage.select}"
							reRender="table,buttons,panel" />
					</rich:column>

					<rich:column>
						<f:facet name="header">Adresa</f:facet>
                 #{p.adresa}
                </rich:column>
                <rich:column>
						<f:facet name="header">Mesto</f:facet>
                 #{p.mesto}
                </rich:column>

				</rich:dataTable>


			</rich:panel>
		</h:form>
	</ui:define>
</ui:composition>
